package file;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;

public class TestFile {

	public static void main(String[] args) throws IOException {

		String webContent = new File("WebContent").getAbsolutePath();
		System.out.println(webContent);
		String s = new File("src").getAbsolutePath();
		System.out.println(s);

		File file = new File("hello.txt");

		System.out.println(file.getAbsolutePath());

		System.out.println(file.getName());

		System.out.println(file.exists());

		file = new File("src/hello.txt");
		System.out.println(file.exists());

		String relativelyPath = System.getProperty("user.dir");

		System.out.println("relativelyPath:" + relativelyPath);
		file = new File(relativelyPath + "/" + "abc.txt");
		// System.out.println(file.exists());
		// file.renameTo(new File(relativelyPath + "/src/abc.txt"));

		System.out.println(file.length());

		File file2 = new File("abcddddd.txt");
		System.out.println("file2:" + file2.exists());
		file2.createNewFile();

		File dir = new File("atguigu");
		System.out.println(dir.isFile());
	}
}
